package com.listener.controller;

import com.listener.dao.AbilityDao;
import com.listener.dao.MoveDao;
import com.listener.dao.PokemonDao;
import com.listener.dao.TypeDao;
import com.listener.pojo.Page;
import com.listener.pojo.Pokemon;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

@Controller
public class CoreController {
    @Autowired
    TypeDao typeDao;
    @Autowired
    AbilityDao abilityDao;
    @Autowired
    MoveDao moveDao;
    @Autowired
    PokemonDao pokemonDao;
    @RequestMapping("/homepage")
    public String homePage(HttpServletRequest request){

        Pokemon pokemonCondition=new Pokemon();
        pokemonCondition.setPokemon("伊布");
        List<Pokemon> eevees =//伊布们
                pokemonDao.selectPokemonPage(pokemonCondition,
                        1,10).getPage();
        request.setAttribute("eevees",eevees);
        return "forward:/web/homepage.jsp";
    }
}
